package com.ssy.lingxi.after.sale.controller;

import com.ssy.lingxi.after.sale.api.model.vo.request.*;
import com.ssy.lingxi.after.sale.service.IReplaceGoodsService;
import com.ssy.lingxi.common.controller.BaseController;
import com.ssy.lingxi.common.response.Wrapper;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu 售后能力-售后换货-内部接口
 * @author 伍将
 * @date 2020/9/17
 * @version 2.0.0
 */
@RestController
@RequestMapping("/as/feign/replaceGoods")
public class ReplaceGoodsFeignController extends BaseController {

    @Resource
    private IReplaceGoodsService replaceGoodsService;

    /**
     * 新增退货发货单
     * @author 伍将
     * @date 2020/9/17
     **/
    @RequestMapping("/addReturnDeliveryGoods")
    public Wrapper<Long> addReturnDeliveryGoods(@RequestBody @Valid ReplaceAddDeliveryGoodsVO addVO) {
        //return replaceGoodsService.addReturnDeliveryGoods(addVO);
        return null;
    }

    /**
     * 删除退货发货单
     * @author 伍将
     * @date 2020/9/29
     **/
    @RequestMapping("/deleteReturnDeliveryGoods")
    public Wrapper<Void> deleteReturnDeliveryGoods(@RequestBody CommonIdVO commonIdVO) {
        return replaceGoodsService.deleteReturnDeliveryGoods(commonIdVO.getDataId());
    }

    /**
     * 审核退货发货单
     * @author 伍将
     * @date 2020/12/22
     **/
    @RequestMapping("/verifyReturnDeliveryGoods")
    public Wrapper<Void> verifyReturnDeliveryGoods(@RequestBody @Valid VerifyDeliveryVO verifyVO) {
        return replaceGoodsService.verifyReturnDeliveryGoods(verifyVO);
    }

    /**
     * 新增退货入库单
     * @author 伍将
     * @date 2020/9/18
     **/
    @RequestMapping("/addReturnGoodsStorage")
    public Wrapper<Void> addReturnGoodsStorage(@RequestBody @Valid ReplaceAddStorageVO addVO) {
        return replaceGoodsService.addReturnGoodsStorage(addVO);
    }

    /**
     * 售后换货处理-待新增退货入库单-审核退货入库
     * @author 伍将
     * @date 2020/9/18
     **/
    @RequestMapping("/verifyReturnGoodsStorage")
    public Wrapper<Void> verifyReturnGoodsStorage(@RequestBody @Valid VerifyDeliveryVO verifyVO) {
        return replaceGoodsService.verifyReturnGoodsStorage(verifyVO);
    }

    /**
     * 售后换货处理-待新增退货入库单-删除退货入库
     * @author 伍将
     * @date 2020/12/22
     **/
    @RequestMapping("/deleteReturnGoodsStorage")
    public Wrapper<Void> deleteReturnGoodsStorage(@RequestBody CommonIdVO commonIdVO) {
        return replaceGoodsService.deleteReturnGoodsStorage(commonIdVO.getDataId());
    }

    /**
     * 新增退货物流
     * @author 伍将
     * @date 2020/9/18
     **/
    @RequestMapping("/addReturnLogistics")
    public Wrapper<Void> addReturnLogistics(@RequestBody @Valid AddLogisticsVO addVO) {
        return replaceGoodsService.addReturnLogistics(addVO);
    }

    /**
     * 删除退货物流
     * @author 伍将
     * @date 2020/9/29
     **/
    @RequestMapping("/deleteReturnLogistics")
    public Wrapper<Void> deleteReturnLogistics(@RequestBody CommonIdVO commonIdVO) {
        return replaceGoodsService.deleteReturnLogistics(commonIdVO.getDataId());
    }

    /**
     * 审核退货物流单
     * @author 伍将
     * @date 2020/9/18
     **/
    @RequestMapping("/verifyReturnLogistics")
    public Wrapper<Void> verifyReturnLogistics(@RequestBody VerifyLogisticsVO verifyVO) {
        return replaceGoodsService.verifyReturnLogistics(verifyVO);
    }

    /**
     * 新增换货发货单
     * @author 伍将
     * @date 2020/9/17
     **/
    @RequestMapping("/addReplaceDeliveryGoods")
    public Wrapper<Long> addReplaceDeliveryGoods(@RequestBody @Valid ReplaceAddDeliveryGoodsVO addVO) {
        return replaceGoodsService.addReplaceDeliveryGoods(addVO);
    }

    /**
     * 删除换货发货单
     * @author 伍将
     * @date 2020/9/29
     **/
    @RequestMapping("/deleteReplaceDeliveryGoods")
    public Wrapper<Void> deleteReplaceDeliveryGoods(@RequestBody CommonIdVO commonIdVO) {
        return replaceGoodsService.deleteReplaceDeliveryGoods(commonIdVO.getDataId());
    }

    /**
     * 审核换货发货单
     * @author 伍将
     * @date 2020/12/22
     **/
    @RequestMapping("/verifyReplaceDeliveryGoods")
    public Wrapper<Void> verifyReplaceDeliveryGoods(@RequestBody @Valid VerifyDeliveryVO verifyVO) {
        return replaceGoodsService.verifyReplaceDeliveryGoods(verifyVO);
    }

    /**
     * 新增换货物流
     * @author 伍将
     * @date 2020/9/18
     **/
    @RequestMapping("/addReplaceLogistics")
    public Wrapper<Void> addReplaceLogistics(@RequestBody @Valid AddLogisticsVO addVO) {
        return replaceGoodsService.addReplaceLogistics(addVO);
    }

    /**
     * 删除换货物流
     * @author 伍将
     * @date 2020/9/29
     **/
    @RequestMapping("/deleteReplaceLogistics")
    public Wrapper<Void> deleteReplaceLogistics(@RequestBody CommonIdVO commonIdVO) {
        return replaceGoodsService.deleteReplaceLogistics(commonIdVO.getDataId());
    }

    /**
     * 审核换货物流单
     * @author 伍将
     * @date 2020/9/18
     **/
    @RequestMapping("/verifyReplaceLogistics")
    public Wrapper<Void> verifyReplaceLogistics(@RequestBody VerifyLogisticsVO verifyVO) {
        return replaceGoodsService.verifyReplaceLogistics(verifyVO);
    }

    /**
     * 新增换货入库单
     * @author 伍将
     * @date 2020/9/18
     **/
    @RequestMapping("/addReplaceGoodsStorage")
    public Wrapper<Void> addReplaceGoodsStorage(@RequestBody @Valid ReplaceAddStorageVO addVO) {
        return replaceGoodsService.addReplaceGoodsStorage(addVO);
    }

    /**
     * 删除换货入库单
     * @author 伍将
     * @date 2020/9/29
     **/
    @RequestMapping("/deleteReplaceGoodsStorage")
    public Wrapper<Void> deleteReplaceGoodsStorage(@RequestBody CommonIdVO commonIdVO) {
        return replaceGoodsService.deleteReplaceGoodsStorage(commonIdVO.getDataId());
    }

    /**
     * 审核换货入库单
     * @author 伍将
     * @date 2020/12/22
     **/
    @RequestMapping("/verifyReplaceGoodsStorage")
    public Wrapper<Void> verifyReplaceGoodsStorage(@RequestBody @Valid VerifyDeliveryVO verifyVO) {
        return replaceGoodsService.verifyReplaceGoodsStorage(verifyVO);
    }
}
